package lang3;

import org.apache.commons.lang3.CharUtils;

/**
 * @ClassName: CharUtil
 * @Author: liugui
 * @Date: 2020-07-14 15:22
 **/
public class CharUtil {
    public static void main(String[] args) {

        char c = '1';
        isAscii(c);//true
        toCharacterObject(c);//1
        toIntValue(c);//1

    }

    public static void isAscii(char c){
        System.out.println(CharUtils.isAscii(c));
    }

    /**
     * 实质使用Character.ValueOf()
     */
    public static Character toCharacterObject(char c){
        System.out.println(CharUtils.toCharacterObject(c));
        return CharUtils.toCharacterObject(c);
    }

    public static Integer toIntValue(char c){
        System.out.println(CharUtils.toIntValue(c));
        return CharUtils.toIntValue(c);
    }
}
